package com.disc.common;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Tonight on 2017/7/18.
 */
public class Constant {

    /**
     * 获取cookie
     */
    public final static String BAIDU_GET_COOKIE = "https://www.baidu.com";

    /**
     * 获取token
     */
    public final static String BAIDU_GET_TOKEN = "https://passport.baidu.com/v2/api/?getapi&tpl=mn&apiver=v3&class=login&tt=%s&logintype=dialogLogin&callback=0";

    /**
     * 获取rsa pulic key
     */
    public final static String BAIDU_GET_PUBLIC_KEY = "https://passport.baidu.com/v2/getpublickey?token=%s";

    /**
     * 登陆url
     */
    public final static String BAIDU_LOGIN = "https://passport.baidu.com/v2/api/?login";

    /**
     * 登陆url
     */
    public final static String BAIDU_VERIFICATION_CODE = "https://passport.baidu.com/cgi-bin/genimage?%s";

    /**
     * 文件操作基本url（web）
     */
    public final static String BAIDU_FILE_BASE_URL = "http://pan.baidu.com/api/%s";


    /**
     * 获取文件下载地址（Android 手机 App）
     */
    public final static String BAIDU_FILE_DOWNLOAD_URL = "https://d.pcs.baidu.com/rest/2.0/pcs/file?method=locatedownload" +
            "&ver=2.0&dtype=0&esl=1&ehps=0&app_id=250528" +
            "&check_blue=1" +
            "&devuid=803941230549168" +
            "&clienttype=1" +
            "&channel=android_7.0_MI%205_bd-netdisk_1002253g&version=7.17.1" +
            "&vip=0&";
/*            "logid={logid}\n" +
            "&time={time}&\n" +
            "rand={rand}"  +
            "&path={path}" +
            "&bdstoken={token}\n";*/


    /**
     * 天翼网盘主页（初始化 cookie）
     */
    public static final String TIANYI_MAIN = "http://cloud.189.cn/main.action";

    /**
     * 天翼网盘登陆页面(获取captchaToken)
     */
    public static final String TIANYI_LOGIN_PAGE = "http://cloud.189.cn/udb/udb_login.jsp?pageId=1&redirectURL=/main.action";

    /**
     * 天翼网盘登陆URL
     */
    public static final String TIANYI_LOGIN_URL = "https://open.e.189.cn/api/logbox/oauth2/loginSubmit.do";

    /**
     * 天翼网盘file list
     */
    public static final String TIANYI_FILE_LIST = "http://cloud.189.cn/v2/listFiles.action?mediaType=&keyword=&inGroupSpace=false&orderBy=1&order=ASC&pageNum=1&pageSize=60&";

    /**
     * 存储已经登陆成功的百度网盘cookie
     * key 账号
     * value cookie
     */
    public static Map<String,Object> cookieStoreMap = new HashMap<>();
    /**
     * 存储下载地址
     * key 账号
     * value cookie
     */
    public static Map<String,Map> fileStoreMap = new HashMap<>();

    public static Map<String,String> errorMessageMap = new HashMap<>();

    static{
        errorMessageMap.put("-1", "系统错误, 请稍后重试");
        errorMessageMap.put("1", "您输入的帐号格式不正确");
        errorMessageMap.put("3", "验证码不存在或已过期,请重新输入");
        errorMessageMap.put("4", "您输入的帐号或密码有误");
        errorMessageMap.put("5", "请在弹出的窗口操作,或重新登录");
        errorMessageMap.put("6", "验证码输入错误");
        errorMessageMap.put("16", "您的帐号因安全问题已被限制登录");
        errorMessageMap.put("257", "需要验证码");
        errorMessageMap.put("100005", "系统错误, 请稍后重试");
        errorMessageMap.put("120016", "未知错误 120016");
        errorMessageMap.put("120019", "近期登录次数过多, 请先通过 passport.baidu.com 解除锁定");
        errorMessageMap.put("120021", "登录失败,请在弹出的窗口操作,或重新登录");
        errorMessageMap.put("500010", "登录过于频繁,请24小时后再试");
        errorMessageMap.put("400031", "账号异常，请在当前网络环境下在百度网页端正常登录一次");
        errorMessageMap.put("401007", "您的手机号关联了其他帐号，请选择登录");
    }


    public static final String HEIKE_INIT_COOKIE_URL  = "http://lx.heikeyun.net/login.aspx";

    public static final String HEIKE_VOODE_URL  = "http://lx.heikeyun.net/LgValidateCode.ashx";

    public static final String HEIKE_HTTPCLIENT_TAG  = "HEIKEY_HTTPCLIENT";

    public static final String HEIKE_HTTPCLIENT_LOGIN_VALUE  = "HEIKE_HTTPCLIENT_LOGIN_VALUE";

    public static final String HEIKE_LOGIN_SUCCESS = "http://lx.heikeyun.net/Main.aspx";


}